/****************************************************************************
 Copyright (c) 2019-2022 Xiamen Yaji Software Co., Ltd.

 http://www.cocos.com

 Permission is hereby granted, free of charge, to any person obtaining a copy
 of this software and associated engine source code (the "Software"), a limited,
 worldwide, royalty-free, non-assignable, revocable and non-exclusive license
 to use Cocos Creator solely to develop games on your target platforms. You shall
 not use Cocos Creator software for developing other software or tools that's
 used for developing games. You are not granted to publish, distribute,
 sublicense, and/or sell copies of Cocos Creator.

 The software or tools in this License Agreement are licensed, not sold.
 Xiamen Yaji Software Co., Ltd. reserves all rights not expressly granted to you.

 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 THE SOFTWARE.
****************************************************************************/

#pragma once

#define GL_GLES_PROTOTYPES 0
#include <GLES3/gl32.h>

/**
 * ========================= !DO NOT CHANGE THE FOLLOWING SECTION MANUALLY! =========================
 * The following section is auto-generated from GLES spec by running:
 * node tools/gles-wrangler-generator/generate.js
 * ========================= !DO NOT CHANGE THE FOLLOWING SECTION MANUALLY! =========================
 */

/* GLES3W_GENERATE_GLES_DECLARATION */
/* GL_ES_VERSION_3_0 */
extern PFNGLREADBUFFERPROC                     glReadBuffer;
extern PFNGLDRAWRANGEELEMENTSPROC              glDrawRangeElements;
extern PFNGLTEXIMAGE3DPROC                     glTexImage3D;
extern PFNGLTEXSUBIMAGE3DPROC                  glTexSubImage3D;
extern PFNGLCOPYTEXSUBIMAGE3DPROC              glCopyTexSubImage3D;
extern PFNGLCOMPRESSEDTEXIMAGE3DPROC           glCompressedTexImage3D;
extern PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC        glCompressedTexSubImage3D;
extern PFNGLGENQUERIESPROC                     glGenQueries;
extern PFNGLDELETEQUERIESPROC                  glDeleteQueries;
extern PFNGLISQUERYPROC                        glIsQuery;
extern PFNGLBEGINQUERYPROC                     glBeginQuery;
extern PFNGLENDQUERYPROC                       glEndQuery;
extern PFNGLGETQUERYIVPROC                     glGetQueryiv;
extern PFNGLGETQUERYOBJECTUIVPROC              glGetQueryObjectuiv;
extern PFNGLUNMAPBUFFERPROC                    glUnmapBuffer;
extern PFNGLGETBUFFERPOINTERVPROC              glGetBufferPointerv;
extern PFNGLDRAWBUFFERSPROC                    glDrawBuffers;
extern PFNGLUNIFORMMATRIX2X3FVPROC             glUniformMatrix2x3fv;
extern PFNGLUNIFORMMATRIX3X2FVPROC             glUniformMatrix3x2fv;
extern PFNGLUNIFORMMATRIX2X4FVPROC             glUniformMatrix2x4fv;
extern PFNGLUNIFORMMATRIX4X2FVPROC             glUniformMatrix4x2fv;
extern PFNGLUNIFORMMATRIX3X4FVPROC             glUniformMatrix3x4fv;
extern PFNGLUNIFORMMATRIX4X3FVPROC             glUniformMatrix4x3fv;
extern PFNGLBLITFRAMEBUFFERPROC                glBlitFramebuffer;
extern PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC glRenderbufferStorageMultisample;
extern PFNGLFRAMEBUFFERTEXTURELAYERPROC        glFramebufferTextureLayer;
extern PFNGLMAPBUFFERRANGEPROC                 glMapBufferRange;
extern PFNGLFLUSHMAPPEDBUFFERRANGEPROC         glFlushMappedBufferRange;
extern PFNGLBINDVERTEXARRAYPROC                glBindVertexArray;
extern PFNGLDELETEVERTEXARRAYSPROC             glDeleteVertexArrays;
extern PFNGLGENVERTEXARRAYSPROC                glGenVertexArrays;
extern PFNGLISVERTEXARRAYPROC                  glIsVertexArray;
extern PFNGLGETINTEGERI_VPROC                  glGetIntegeri_v; // NOLINT(readability-identifier-naming)
extern PFNGLBEGINTRANSFORMFEEDBACKPROC         glBeginTransformFeedback;
extern PFNGLENDTRANSFORMFEEDBACKPROC           glEndTransformFeedback;
extern PFNGLBINDBUFFERRANGEPROC                glBindBufferRange;
extern PFNGLBINDBUFFERBASEPROC                 glBindBufferBase;
extern PFNGLTRANSFORMFEEDBACKVARYINGSPROC      glTransformFeedbackVaryings;
extern PFNGLGETTRANSFORMFEEDBACKVARYINGPROC    glGetTransformFeedbackVarying;
extern PFNGLVERTEXATTRIBIPOINTERPROC           glVertexAttribIPointer;
extern PFNGLGETVERTEXATTRIBIIVPROC             glGetVertexAttribIiv;
extern PFNGLGETVERTEXATTRIBIUIVPROC            glGetVertexAttribIuiv;
extern PFNGLVERTEXATTRIBI4IPROC                glVertexAttribI4i;
extern PFNGLVERTEXATTRIBI4UIPROC               glVertexAttribI4ui;
extern PFNGLVERTEXATTRIBI4IVPROC               glVertexAttribI4iv;
extern PFNGLVERTEXATTRIBI4UIVPROC              glVertexAttribI4uiv;
extern PFNGLGETUNIFORMUIVPROC                  glGetUniformuiv;
extern PFNGLGETFRAGDATALOCATIONPROC            glGetFragDataLocation;
extern PFNGLUNIFORM1UIPROC                     glUniform1ui;
extern PFNGLUNIFORM2UIPROC                     glUniform2ui;
extern PFNGLUNIFORM3UIPROC                     glUniform3ui;
extern PFNGLUNIFORM4UIPROC                     glUniform4ui;
extern PFNGLUNIFORM1UIVPROC                    glUniform1uiv;
extern PFNGLUNIFORM2UIVPROC                    glUniform2uiv;
extern PFNGLUNIFORM3UIVPROC                    glUniform3uiv;
extern PFNGLUNIFORM4UIVPROC                    glUniform4uiv;
extern PFNGLCLEARBUFFERIVPROC                  glClearBufferiv;
extern PFNGLCLEARBUFFERUIVPROC                 glClearBufferuiv;
extern PFNGLCLEARBUFFERFVPROC                  glClearBufferfv;
extern PFNGLCLEARBUFFERFIPROC                  glClearBufferfi;
extern PFNGLGETSTRINGIPROC                     glGetStringi;
extern PFNGLCOPYBUFFERSUBDATAPROC              glCopyBufferSubData;
extern PFNGLGETUNIFORMINDICESPROC              glGetUniformIndices;
extern PFNGLGETACTIVEUNIFORMSIVPROC            glGetActiveUniformsiv;
extern PFNGLGETUNIFORMBLOCKINDEXPROC           glGetUniformBlockIndex;
extern PFNGLGETACTIVEUNIFORMBLOCKIVPROC        glGetActiveUniformBlockiv;
extern PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC      glGetActiveUniformBlockName;
extern PFNGLUNIFORMBLOCKBINDINGPROC            glUniformBlockBinding;
extern PFNGLDRAWARRAYSINSTANCEDPROC            glDrawArraysInstanced;
extern PFNGLDRAWELEMENTSINSTANCEDPROC          glDrawElementsInstanced;
extern PFNGLFENCESYNCPROC                      glFenceSync;
extern PFNGLISSYNCPROC                         glIsSync;
extern PFNGLDELETESYNCPROC                     glDeleteSync;
extern PFNGLCLIENTWAITSYNCPROC                 glClientWaitSync;
extern PFNGLWAITSYNCPROC                       glWaitSync;
extern PFNGLGETINTEGER64VPROC                  glGetInteger64v;
extern PFNGLGETSYNCIVPROC                      glGetSynciv;
extern PFNGLGETINTEGER64I_VPROC                glGetInteger64i_v; // NOLINT(readability-identifier-naming)
extern PFNGLGETBUFFERPARAMETERI64VPROC         glGetBufferParameteri64v;
extern PFNGLGENSAMPLERSPROC                    glGenSamplers;
extern PFNGLDELETESAMPLERSPROC                 glDeleteSamplers;
extern PFNGLISSAMPLERPROC                      glIsSampler;
extern PFNGLBINDSAMPLERPROC                    glBindSampler;
extern PFNGLSAMPLERPARAMETERIPROC              glSamplerParameteri;
extern PFNGLSAMPLERPARAMETERIVPROC             glSamplerParameteriv;
extern PFNGLSAMPLERPARAMETERFPROC              glSamplerParameterf;
extern PFNGLSAMPLERPARAMETERFVPROC             glSamplerParameterfv;
extern PFNGLGETSAMPLERPARAMETERIVPROC          glGetSamplerParameteriv;
extern PFNGLGETSAMPLERPARAMETERFVPROC          glGetSamplerParameterfv;
extern PFNGLVERTEXATTRIBDIVISORPROC            glVertexAttribDivisor;
extern PFNGLBINDTRANSFORMFEEDBACKPROC          glBindTransformFeedback;
extern PFNGLDELETETRANSFORMFEEDBACKSPROC       glDeleteTransformFeedbacks;
extern PFNGLGENTRANSFORMFEEDBACKSPROC          glGenTransformFeedbacks;
extern PFNGLISTRANSFORMFEEDBACKPROC            glIsTransformFeedback;
extern PFNGLPAUSETRANSFORMFEEDBACKPROC         glPauseTransformFeedback;
extern PFNGLRESUMETRANSFORMFEEDBACKPROC        glResumeTransformFeedback;
extern PFNGLGETPROGRAMBINARYPROC               glGetProgramBinary;
extern PFNGLPROGRAMBINARYPROC                  glProgramBinary;
extern PFNGLPROGRAMPARAMETERIPROC              glProgramParameteri;
extern PFNGLINVALIDATEFRAMEBUFFERPROC          glInvalidateFramebuffer;
extern PFNGLINVALIDATESUBFRAMEBUFFERPROC       glInvalidateSubFramebuffer;
extern PFNGLTEXSTORAGE2DPROC                   glTexStorage2D;
extern PFNGLTEXSTORAGE3DPROC                   glTexStorage3D;
extern PFNGLGETINTERNALFORMATIVPROC            glGetInternalformativ;

/* GL_ES_VERSION_3_1 */
extern PFNGLDISPATCHCOMPUTEPROC         glDispatchCompute;
extern PFNGLDISPATCHCOMPUTEINDIRECTPROC glDispatchComputeIndirect;

extern PFNGLDRAWARRAYSINDIRECTPROC   glDrawArraysIndirect;
extern PFNGLDRAWELEMENTSINDIRECTPROC glDrawElementsIndirect;

extern PFNGLFRAMEBUFFERPARAMETERIPROC     glFramebufferParameteri;
extern PFNGLGETFRAMEBUFFERPARAMETERIVPROC glGetFramebufferParameteriv;

extern PFNGLGETPROGRAMINTERFACEIVPROC      glGetProgramInterfaceiv;
extern PFNGLGETPROGRAMRESOURCEINDEXPROC    glGetProgramResourceIndex;
extern PFNGLGETPROGRAMRESOURCENAMEPROC     glGetProgramResourceName;
extern PFNGLGETPROGRAMRESOURCEIVPROC       glGetProgramResourceiv;
extern PFNGLGETPROGRAMRESOURCELOCATIONPROC glGetProgramResourceLocation;

extern PFNGLUSEPROGRAMSTAGESPROC          glUseProgramStages;
extern PFNGLACTIVESHADERPROGRAMPROC       glActiveShaderProgram;
extern PFNGLCREATESHADERPROGRAMVPROC      glCreateShaderProgramv;
extern PFNGLBINDPROGRAMPIPELINEPROC       glBindProgramPipeline;
extern PFNGLDELETEPROGRAMPIPELINESPROC    glDeleteProgramPipelines;
extern PFNGLGENPROGRAMPIPELINESPROC       glGenProgramPipelines;
extern PFNGLISPROGRAMPIPELINEPROC         glIsProgramPipeline;
extern PFNGLGETPROGRAMPIPELINEIVPROC      glGetProgramPipelineiv;
extern PFNGLPROGRAMUNIFORM1IPROC          glProgramUniform1i;
extern PFNGLPROGRAMUNIFORM2IPROC          glProgramUniform2i;
extern PFNGLPROGRAMUNIFORM3IPROC          glProgramUniform3i;
extern PFNGLPROGRAMUNIFORM4IPROC          glProgramUniform4i;
extern PFNGLPROGRAMUNIFORM1UIPROC         glProgramUniform1ui;
extern PFNGLPROGRAMUNIFORM2UIPROC         glProgramUniform2ui;
extern PFNGLPROGRAMUNIFORM3UIPROC         glProgramUniform3ui;
extern PFNGLPROGRAMUNIFORM4UIPROC         glProgramUniform4ui;
extern PFNGLPROGRAMUNIFORM1FPROC          glProgramUniform1f;
extern PFNGLPROGRAMUNIFORM2FPROC          glProgramUniform2f;
extern PFNGLPROGRAMUNIFORM3FPROC          glProgramUniform3f;
extern PFNGLPROGRAMUNIFORM4FPROC          glProgramUniform4f;
extern PFNGLPROGRAMUNIFORM1IVPROC         glProgramUniform1iv;
extern PFNGLPROGRAMUNIFORM2IVPROC         glProgramUniform2iv;
extern PFNGLPROGRAMUNIFORM3IVPROC         glProgramUniform3iv;
extern PFNGLPROGRAMUNIFORM4IVPROC         glProgramUniform4iv;
extern PFNGLPROGRAMUNIFORM1UIVPROC        glProgramUniform1uiv;
extern PFNGLPROGRAMUNIFORM2UIVPROC        glProgramUniform2uiv;
extern PFNGLPROGRAMUNIFORM3UIVPROC        glProgramUniform3uiv;
extern PFNGLPROGRAMUNIFORM4UIVPROC        glProgramUniform4uiv;
extern PFNGLPROGRAMUNIFORM1FVPROC         glProgramUniform1fv;
extern PFNGLPROGRAMUNIFORM2FVPROC         glProgramUniform2fv;
extern PFNGLPROGRAMUNIFORM3FVPROC         glProgramUniform3fv;
extern PFNGLPROGRAMUNIFORM4FVPROC         glProgramUniform4fv;
extern PFNGLPROGRAMUNIFORMMATRIX2FVPROC   glProgramUniformMatrix2fv;
extern PFNGLPROGRAMUNIFORMMATRIX3FVPROC   glProgramUniformMatrix3fv;
extern PFNGLPROGRAMUNIFORMMATRIX4FVPROC   glProgramUniformMatrix4fv;
extern PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC glProgramUniformMatrix2x3fv;
extern PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC glProgramUniformMatrix3x2fv;
extern PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC glProgramUniformMatrix2x4fv;
extern PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC glProgramUniformMatrix4x2fv;
extern PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC glProgramUniformMatrix3x4fv;
extern PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC glProgramUniformMatrix4x3fv;
extern PFNGLVALIDATEPROGRAMPIPELINEPROC   glValidateProgramPipeline;
extern PFNGLGETPROGRAMPIPELINEINFOLOGPROC glGetProgramPipelineInfoLog;

extern PFNGLBINDIMAGETEXTUREPROC      glBindImageTexture;
extern PFNGLGETBOOLEANI_VPROC         glGetBooleani_v; // NOLINT(readability-identifier-naming)
extern PFNGLMEMORYBARRIERPROC         glMemoryBarrier;
extern PFNGLMEMORYBARRIERBYREGIONPROC glMemoryBarrierByRegion;

extern PFNGLTEXSTORAGE2DMULTISAMPLEPROC glTexStorage2DMultisample;
extern PFNGLGETMULTISAMPLEFVPROC        glGetMultisamplefv;
extern PFNGLSAMPLEMASKIPROC             glSampleMaski;
extern PFNGLGETTEXLEVELPARAMETERIVPROC  glGetTexLevelParameteriv;
extern PFNGLGETTEXLEVELPARAMETERFVPROC  glGetTexLevelParameterfv;

extern PFNGLBINDVERTEXBUFFERPROC     glBindVertexBuffer;
extern PFNGLVERTEXATTRIBFORMATPROC   glVertexAttribFormat;
extern PFNGLVERTEXATTRIBIFORMATPROC  glVertexAttribIFormat;
extern PFNGLVERTEXATTRIBBINDINGPROC  glVertexAttribBinding;
extern PFNGLVERTEXBINDINGDIVISORPROC glVertexBindingDivisor;

/* GL_ES_VERSION_3_2 */
extern PFNGLBLENDBARRIERPROC glBlendBarrier;

extern PFNGLCOPYIMAGESUBDATAPROC glCopyImageSubData;

extern PFNGLDEBUGMESSAGECONTROLPROC  glDebugMessageControl;
extern PFNGLDEBUGMESSAGEINSERTPROC   glDebugMessageInsert;
extern PFNGLDEBUGMESSAGECALLBACKPROC glDebugMessageCallback;
extern PFNGLGETDEBUGMESSAGELOGPROC   glGetDebugMessageLog;
extern PFNGLPUSHDEBUGGROUPPROC       glPushDebugGroup;
extern PFNGLPOPDEBUGGROUPPROC        glPopDebugGroup;
extern PFNGLOBJECTLABELPROC          glObjectLabel;
extern PFNGLGETOBJECTLABELPROC       glGetObjectLabel;
extern PFNGLOBJECTPTRLABELPROC       glObjectPtrLabel;
extern PFNGLGETOBJECTPTRLABELPROC    glGetObjectPtrLabel;
extern PFNGLGETPOINTERVPROC          glGetPointerv;

extern PFNGLENABLEIPROC                glEnablei;
extern PFNGLDISABLEIPROC               glDisablei;
extern PFNGLBLENDEQUATIONIPROC         glBlendEquationi;
extern PFNGLBLENDEQUATIONSEPARATEIPROC glBlendEquationSeparatei;
extern PFNGLBLENDFUNCIPROC             glBlendFunci;
extern PFNGLBLENDFUNCSEPARATEIPROC     glBlendFuncSeparatei;
extern PFNGLCOLORMASKIPROC             glColorMaski;
extern PFNGLISENABLEDIPROC             glIsEnabledi;

extern PFNGLDRAWELEMENTSBASEVERTEXPROC          glDrawElementsBaseVertex;
extern PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC     glDrawRangeElementsBaseVertex;
extern PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC glDrawElementsInstancedBaseVertex;

extern PFNGLFRAMEBUFFERTEXTUREPROC glFramebufferTexture;

extern PFNGLPRIMITIVEBOUNDINGBOXPROC glPrimitiveBoundingBox;

extern PFNGLGETGRAPHICSRESETSTATUSPROC glGetGraphicsResetStatus;
extern PFNGLREADNPIXELSPROC            glReadnPixels;
extern PFNGLGETNUNIFORMFVPROC          glGetnUniformfv;
extern PFNGLGETNUNIFORMIVPROC          glGetnUniformiv;
extern PFNGLGETNUNIFORMUIVPROC         glGetnUniformuiv;

extern PFNGLMINSAMPLESHADINGPROC glMinSampleShading;

extern PFNGLPATCHPARAMETERIPROC glPatchParameteri;

extern PFNGLTEXPARAMETERIIVPROC         glTexParameterIiv;
extern PFNGLTEXPARAMETERIUIVPROC        glTexParameterIuiv;
extern PFNGLGETTEXPARAMETERIIVPROC      glGetTexParameterIiv;
extern PFNGLGETTEXPARAMETERIUIVPROC     glGetTexParameterIuiv;
extern PFNGLSAMPLERPARAMETERIIVPROC     glSamplerParameterIiv;
extern PFNGLSAMPLERPARAMETERIUIVPROC    glSamplerParameterIuiv;
extern PFNGLGETSAMPLERPARAMETERIIVPROC  glGetSamplerParameterIiv;
extern PFNGLGETSAMPLERPARAMETERIUIVPROC glGetSamplerParameterIuiv;

extern PFNGLTEXBUFFERPROC      glTexBuffer;
extern PFNGLTEXBUFFERRANGEPROC glTexBufferRange;

extern PFNGLTEXSTORAGE3DMULTISAMPLEPROC glTexStorage3DMultisample;

/* GLES3W_GENERATE_GLES_DECLARATION */

/**
 * ========================= !DO NOT CHANGE THE ABOVE SECTION MANUALLY! =========================
 * The above section is auto-generated from GLES spec by running:
 * node tools/gles-wrangler-generator/generate.js
 * ========================= !DO NOT CHANGE THE ABOVE SECTION MANUALLY! =========================
 */

using PFNGLES3WLOADPROC = void *(*)(const char *);
void gles3wLoadProcs(PFNGLES3WLOADPROC gles3wLoad);
